use std::collections::HashMap;

use axum_app_common::ServiceStore;

pub mod cache;
pub mod handler;
pub mod model;
pub mod service;

pub use axum_app_dao::model::UserStatus;
pub use axum_app_dao::user_dal;

pub fn service_map() -> ServiceStore {
    let mut store = ServiceStore::new();

    // 注册user下的handler
    store.add_service_store(
        <handler::user::UserHandler as axum_app_common::BizHandler>::service_map(),
    );

    // 注册role下的handler
    store.add_service_store(
        <handler::role::RoleHandler as axum_app_common::BizHandler>::service_map(),
    );

    // 注册rbac下的handler
    store.add_service_store(
        <handler::rbac::RbacHandler as axum_app_common::BizHandler>::service_map(),
    );

    // 注册sys下的handler
    store.add_service_store(
        <handler::sys::SysHandler as axum_app_common::BizHandler>::service_map(),
    );

    // 注册资源下的handler
    store.add_service_store(
        <handler::resource::ResourceHandler as axum_app_common::BizHandler>::service_map(),
    );

    store
}
